﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Qiang.Geometry
{
    public class MultiCurve : GeometryCollection,IMultiCurve
    {

        #region 初始化


        #endregion


        #region IMultiCurve成员


        ICurve[] _geometries;

        public new ICurve[] Geometries
        {
            get { return _geometries; }
            set { _geometries = value; }
        }

        /// <summary>
        /// 是否为封闭图形。
        /// 集合内所有曲线为封闭时返回true,否则返回false.
        /// </summary>
        public bool IsClosed
        {
            get
            {
                foreach (ICurve curve in _geometries)
                {
                    if (curve.IsClosed == false) return false;
                }
                return true;
            }
        }

        /// <summary>
        /// 长度
        /// </summary>
        public double Length
        {
            get { return ComputeLength(); }
        }


        #endregion
        

        #region 方法

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        protected virtual double ComputeLength()
        {
            return 0;
        }


        #endregion
        

        #region Geometry成员

        /// <summary>
        /// 坐标集合
        /// </summary>
        public override IList<Coordinate> Coordinates
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public override int Dimension
        {
            get { throw new NotImplementedException(); }
        }

        /// <summary>
        /// 是否为简单图形。
        /// </summary>
        public override bool IsSimple
        {
            get { throw new NotImplementedException(); }
        }

        /// <summary>
        /// 几何类型。
        /// </summary>
        public override GeometryType GeometryType
        {
            get { return Qiang.Geometry.GeometryType.MultiCurve; }
        }



        #endregion
        

        #region SQL


        public override string AsText()
        {
            throw new NotImplementedException();
        }

        public override byte[] AsBinarry()
        {
            throw new NotImplementedException();
        }


        #endregion



    }
}
